﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using KardexSist.Library;
using KardexSist.UserControls.Distributor;

namespace KardexSist.UserControls.Common
{
    public partial class CtrlMainBase : UserControl
    {
        public String TitleControl
        {
            get { return lblCaption.Text; }

            set { lblCaption.Text = value; }
        }

        private IOperations IOperation;
        //
        public CtrlMainBase()
        {
            InitializeComponent();

        }

        private void CtrlMainBase_Load(object sender, EventArgs e)
        {

        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            IOperation.Add();
        }


        private void btnDelete_Click(object sender, EventArgs e)
        {
            IOperation.Delete();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            IOperation.Save();
        }

        private void btnExport_Click(object sender, EventArgs e)
        {
            IOperation.Export();
        }

        private void CtrlMainBase_ControlAdded(object sender, ControlEventArgs e)
        {
            Control ctrlAdded = (Control)sender;
            IOperation = ctrlAdded as IOperations;
        }
    }
}